package cn.wolfcode.crm.web.controller;

import cn.wolfcode.crm.mapper.PotentialStudentMapper;
import cn.wolfcode.crm.query.StudentQuery;
import cn.wolfcode.crm.service.IPotentialStudentService;
import cn.wolfcode.crm.service.IStudentManagementService;
import cn.wolfcode.crm.util.JSONResult;
import cn.wolfcode.crm.util.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("chart")
public class ChartController {
    @Autowired
    private IStudentManagementService studentManagementService;
    @Autowired
    private PotentialStudentMapper potentialStudentMapper;

    @RequestMapping("view")
    public String view(){
        return "chart/chart";
    }

    @ResponseBody
    @RequestMapping("query")
    public PageResult query(StudentQuery q){
        PageResult pageResult = studentManagementService.getPageResult(q);
        return pageResult;
    }

    @RequestMapping("saleByBar")
    public String saleByBar(){
        return "echarts/Bar";
    }

    @RequestMapping("saleByPic")
    public String saleByPic(){
        return "echarts/Pic";
    }

    @RequestMapping("map")
    public String map(){
        return "map";
    }
}
